<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/framework/tld" prefix="ex"%>
<c:import url="/sys/common/sys_header.jsp"></c:import>
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-lg-10">
	<ol class="breadcrumb">
		<li><i class="fa fa-arrow-circle-o-right"></i>商品管理</li>
		<li class="active"><strong><c:if test="${entity.id <= 0}">新增</c:if><c:if test="${entity.id > 0}">修改</c:if>用户</strong></li>
	</ol>
</div>
<div class="col-lg-2"></div>
</div>
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="row">
		<div class="col-lg-12">
			<div class="ibox float-e-margins">
				<div class="ibox-content">
					<form method="post" class="form-horizontal" action="<c:url value="edit.do"/>" id="Form">
						<input type="hidden" name="id" value="${entity.id }">
						<div class="hr-line-dashed"></div>

						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="text-danger">*&nbsp;</span>商品名：</label>
							<div class="col-sm-10">
								<div class="row">
									<div class="col-md-4">
										<input type="text" class="form-control" maxlength="100" name="name" id="name" autocomplete="off" value="${entity.name}">
									</div>
								</div>
							</div>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="text-danger">*&nbsp;</span>介绍：</label>
							<div class="col-sm-10">
								<div class="row">
									<div class="col-md-4">
										<input type="text" class="form-control" maxlength="100" name="info" id="info" autocomplete="off" value="${entity.info}">
									</div>
								</div>
							</div>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="text-danger">*&nbsp;</span>价格：</label>
							<div class="col-sm-10">
								<div class="row">
									<div class="col-md-4">
										<input type="text" class="form-control" maxlength="100" name="price" id="price" autocomplete="off" value="${entity.price}">
									</div>
								</div>
							</div>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="text-danger">*&nbsp;</span>是否上架：</label>
							<div class="col-sm-10">
								<div class="row">
									<div class="col-md-4">
										<input type="text" class="form-control" maxlength="100" name="shelves" id="shelves" autocomplete="off" value="${entity.shelves}">
									</div>
								</div>
							</div>
						</div>
						<div class="hr-line-dashed"></div>

						<div class="form-group">
							<div class="col-sm-4 col-sm-offset-2">
								<button class="btn btn-primary" type="submit">提 交</button>
								<button class="btn btn-white m_l_10" type="button" onclick="location.href='<c:url value='backList.do' />';">取 消</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<ex:javascript src="/script/common/check.js"></ex:javascript>
<ex:javascript src="/script/common/uploadify.js"></ex:javascript>
	<script>
		$(document).ready(function() {
			$('.input-date').exDatepicker();

		});
		require(["validate"] ,function(){
			$("#Form").exValidate({
				rules: {
					name: {
						requireInput: true,
						maxlength:18
					}
				},
				submitHandler: function(form) {
					$(form).exAjaxSubmit({
						dataType : "json",
						success:function(result){
							if(result.type == "success") {
								showSuccess("保存成功",function(){
									location.href = "<c:url value="backList.do" />"
								});
							} else {
                                showError(result.msg,function(){});
							}
						}
					});
					return false;
				}
			});
			$.validator.addMethod("requireInput", function(value, element) {
				$(element).val($.trim(value));
				return $.trim(value).length > 0;
			});
		});
	</script>
<c:import url="/sys/common/sys_footer.jsp"></c:import>